﻿using System;
namespace Producers.Kis.Xtee.Riik.Ee.Producer.Kis {
    
    
    public class ClaimProceedings : global::Xtee.Core.Schema.XsdInteger {
        
        public const decimal VOLGNIKUVASTUVAITEKORRALSOOVINMENETLUSEJATKAMISTHAGIMENETLUSES = 1;
        
        public const decimal VOLGNIKUVASTUVAITEKORRALSOOVINMENETLUSELOPETAMIST = 2;
        
        public ClaimProceedings(decimal value) : 
                base(value) {
            this.Pattern = @"(1|2)";
            this.Validate();
            string annot = null;
            if (Value == 1) {
                annot = "volgniku vastuvaite korral soovin menetluse jatkamist hagimenetluses";
            }
            if (Value == 2) {
                annot = "volgniku vastuvaite korral soovin menetluse lopetamist";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public ClaimProceedings(string value) : 
                base(value) {
            this.Pattern = @"(1|2)";
            this.Validate();
            string annot = null;
            if (Value == 1) {
                annot = "volgniku vastuvaite korral soovin menetluse jatkamist hagimenetluses";
            }
            if (Value == 2) {
                annot = "volgniku vastuvaite korral soovin menetluse lopetamist";
            }
            if (annot!=null) {
                this._annotation = annot;
            }
            else {
                throw new global::Xtee.Core.Types.XteeSimpleTypeValidationException(string.Format("Enumeration on [{0}] does not allow value : [{1}] ", this.GetType().Name,Value.ToString()));;
            }
        }
        
        public ClaimProceedings() : 
                base(new decimal()) {
        }
        
        public static bool TryParse(string value, out global::Producers.Kis.Xtee.Riik.Ee.Producer.Kis.ClaimProceedings result) {
            try {
                result = new global::Producers.Kis.Xtee.Riik.Ee.Producer.Kis.ClaimProceedings(value);
                return true;
            }
            catch (System.Exception ) {
                result = null;
                return false;
            }
        }
        
        public static implicit operator Decimal (ClaimProceedings value) {
            return value.Value;
        }
        
        public static implicit operator ClaimProceedings (decimal value) {
            return new ClaimProceedings(value);
        }
    }
}
